<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:r="http://richfaces.org/rich" 
	xmlns:a="http://richfaces.org/a4j"
	xmlns:ad="http://agiledev.com.br/fieldset" xmlns:p="http://primefaces.prime.com.tr/ui">

	<ad:fieldset id="fshow" legenda="#{messages.associacao}" rendered="#{not empty sprintPlanMB.sprint and not empty sprintPlanMB.sprint.oid}">

		<r:dataTable id="dtHow" value="#{sprintPlanMB.sprint.itens}" var="backlog" width="100%">

			<r:column>
				<f:facet name="header">
					<h:outputText value="#{messages.nome}" />
				</f:facet>

				<h:outputText value="#{backlog.item.nome}" />
			</r:column>

			<r:column>
				<f:facet name="header">
					<h:outputText value="#{messages.prioridade}" />
				</f:facet>

				<ui:include src="/pages/item/prioridade.xhtml">
					<ui:param name="valor" value="#{backlog.item.prioridade}" />
				</ui:include>
			</r:column>

			<r:column>
				<f:facet name="header">
					<h:outputText value="#{messages.estimativa}" />
				</f:facet>

				<h:outputText value="#{backlog.item.estimativa}">
					<f:convertNumber maxFractionDigits="1"/>
				</h:outputText>				
			</r:column>

			<r:column styleClass="centro" width="10%">
				<f:facet name="header">
					<h:outputText value="#{messages.acoes}" />
				</f:facet>
		
				<h:graphicImage value="/img/note_add.png" style="cursor: pointer;" title="#{messages.novo}">
					<a:support event="onclick" action="#{sprintPlanMB.newTask(backlog.item)}" ajaxSingle="true" reRender="mpTask" data="#{eventContext.get('controle')}" oncomplete="if(data == 'sucesso'){Richfaces.showModalPanel('mpTask');}"/>
				</h:graphicImage>
				
			</r:column>

			<r:subTable value="#{backlog.item.tarefas}" var="task" width="100%">
		
				<r:column colspan="3">
					<h:outputText value="#{task.descricao}" />
				</r:column>
				
				<r:column styleClass="centro" width="10%">
					<a:commandLink action="#{sprintPlanMB.editTask(task)}" ajaxSingle="true" title="#{messages.editar}" reRender="mpTask" data="#{eventContext.get('controle')}" oncomplete="if(data == 'sucesso'){Richfaces.showModalPanel('mpTask');}">
						<h:graphicImage value="/img/note_edit.png" />
					</a:commandLink>
				</r:column>
		
			</r:subTable>

		</r:dataTable>

	</ad:fieldset>

</ui:composition>